QT       += core gui
QT       += network
QT += sql
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
RC_ICONS = "icon/app.ico"
CONFIG += c++17

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
    AlgManager/CHVisionAdvX.cpp \
    AlgManager/CMeCamera.cpp \
    AlgManager/CPlateB.cpp \
    AlgManager/CPreProcess.cpp \
    AlgManager/algorithmservice.cpp \
    AlgManager/imagestoragemanager.cpp \
    AlgManager/pathdataparser.cpp \
    CameraManager/cameraservice.cpp \
    CameraManager/imagewindow.cpp \
    CameraManager/mecameramanager.cpp \
    CameraManager/mecameraworker.cpp \
    Common/sysenv.cpp \
    Common/syslogmanager.cpp \
    DatabaseManager/databasemanager.cpp \
    DatabaseManager/databaseservice.cpp \
    DatabaseManager/dataxjsonconverter.cpp \
    DatabaseManager/genericjsonconverter.cpp \
    DeviceManager/copperparticledevice.cpp \
    DeviceManager/devicecommservice.cpp \
    DeviceManager/devicecontroller.cpp \
    DeviceManager/deviceworker.cpp \
    DeviceManager/fixturemanager.cpp \
    DeviceManager/protocolparser.cpp \
    main.cpp \
    mainwindow.cpp \
    taskmanager.cpp

HEADERS += \
    AlgManager/CHVisionAdvX.h \
    AlgManager/CMeCamera.h \
    AlgManager/CPlateB.h \
    AlgManager/CPreProcess.h \
    AlgManager/DataX.h \
    AlgManager/algorithmservice.h \
    AlgManager/imagestoragemanager.h \
    AlgManager/pathdataparser.h \
    CameraManager/cameraservice.h \
    CameraManager/imagewindow.h \
    CameraManager/mecameramanager.h \
    CameraManager/mecameraworker.h \
    Common/hardware_task_queue.h \
    Common/status_table.h \
    Common/sysenv.h \
    Common/syslogmanager.h \
    Common/system_logs.h \
    DatabaseManager/databasemanager.h \
    DatabaseManager/databaseservice.h \
    DatabaseManager/dataxjsonconverter.h \
    DatabaseManager/genericjsonconverter.h \
    DeviceManager/copperparticledevice.h \
    DeviceManager/devicecommservice.h \
    DeviceManager/devicecontroller.h \
    DeviceManager/deviceworker.h \
    DeviceManager/enums.h \
    DeviceManager/fixturemanager.h \
    DeviceManager/protocolparser.h \
    DeviceManager/types.h \
    mainwindow.h \
    taskmanager.h

FORMS += \
    mainwindow.ui

TRANSLATIONS += \
    MzPoliShine_zh_CN.ts

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
include($$PWD/SaveLog/savelog.pri)

CONFIG(debug, debug|release) {
    DESTDIR = $$PWD/Bin/x64/Debug
} else {
    DESTDIR = $$PWD/Bin/x64/Release
}

# 支持中文编码
CODECFORTR = UTF-8
CODECFORSRC = UTF-8

# 设置字符集
DEFINES += QT_DEPRECATED_WARNINGS \
           SOURCE_CHARSET=UTF-8 \
           EXECUTION_CHARSET=UTF-8

# 如果你使用MSVC编译器，添加以下配置
win32-msvc* {
    QMAKE_CXXFLAGS += /utf-8
    QMAKE_CFLAGS += /utf-8
}
#---------------------------------------halcon 22.05---------------------------------------------------
win32 {
    # HALCON 根目录 (处理路径空格)
    HALCON_DIR = $$quote(C:/Program Files/MVTec/HALCON-22.05-Progress)

    # 包含路径
    INCLUDEPATH += $$HALCON_DIR/include \
                   $$HALCON_DIR/include/halconcpp

    # 库路径
    LIBS += -L$$HALCON_DIR/lib/x64-win64

    # 链接 HALCON 库（始终使用同一组库，不分 Debug/Release）
    LIBS += -lhalcon      # halcon.lib
    LIBS += -lhalconcpp   # halconcpp.lib
}

DISTFILES += \
    ReadMe.md
    # -----------------------------------------------Mech-Eye SDK-----------------------------------------------
    # 设置SDK路径变量
    MECH_EYE_SDK = $$quote(C:/Mech-Mind/Mech-Eye SDK-2.5.1/API)

    # 包含目录
    INCLUDEPATH += $$MECH_EYE_SDK/include

    # 库目录
    win32 {
        # 根据构建类型选择不同的库路径
        CONFIG(debug, debug|release) {
            LIBS += -L$$MECH_EYE_SDK/lib_debug
            LIBS += -L$$MECH_EYE_SDK/dll_debug
        } else {
            LIBS += -L$$MECH_EYE_SDK/lib
            LIBS += -L$$MECH_EYE_SDK/dll
        }
    }

    # 链接库
    win32 {
        CONFIG(debug, debug|release) {
            LIBS += -lMechEyeApid  # 调试版本库
        } else {
            LIBS += -lMechEyeApi   # 发布版本库
        }
    }

RESOURCES += \
    res.qrc

